﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Iesi.Collections;
using Iesi.Collections.Generic;
using System.Collections.ObjectModel;

namespace VisualAgile.Model
{
    [Serializable]
    public class Status  
    {       
        /// <summary>
        /// Created Date
        /// </summary>
        public virtual DateTime CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// Created by
        /// </summary>
        public virtual System.String Creator
        {
            get;
            set;
        }

        /// <summary>
        /// Iteration ID
        /// </summary>
        public virtual Guid StatusID
        {
            get;
            set;
        }

        /// <summary>
        /// Project ID
        /// </summary>
        public virtual System.String IterationID
        {
            get;
            set;
        }      

        /// <summary>
        /// Iteration name
        /// </summary>
        public virtual System.String Name
        {
            get;
            set;
        }

        private ISet<Task> _tasks = new HashedSet<Task>();

        public virtual ReadOnlyCollection<Task> Tasks
        {
            get { return new List<Task>(_tasks).AsReadOnly(); }
        }

        public virtual void AddTask(Task task)
        {
            task.Status = this;
            _tasks.Add(task);
        }

        public virtual void RemoveTask(Task n)
        {
            _tasks.Remove(n);
        }
    }
}
